import request from '@/utils/request'
// 新增商品
export function doAddGoods (params) {
  return request({
    url: '/admin/add_goods',
    method: 'post',
    data: params
  })
}
// 获取产品类型
export function getGoodsType (params) {
  return request({
    url: '/admin/get_goods_type',
    method: 'get',
    parameter: params
  })
}
// 检测商品是否可以提交
export function checkGoodsInfo (params) {
  return request({
    url: '/admin/check_goods_info',
    method: 'post',
    data: params
  })
}
// 获取商品分类
export function getClassInfo (params) {
  return request({
    url: '/admin/get_class_info',
    method: 'get',
    data: params
  })
}
// 上传
export function upload (params) {
  return request({
    url: '/api/upload',
    method: 'post',
    data: params
  })
}
// 优惠卷检测
export function checkCouponInfo (params) {
  return request({
    url: '/admin/check_coupon_info',
    method: 'post',
    data: params
  })
}
// 获取自己的商品列表
export function getGoodsInfo (params) {
  return request({
    url: '/admin/get_goods_info',
    method: 'get',
    params: params
  })
}
// 暂停商品
export function stopGoods (params) {
  return request({
    url: '/admin/stop_goods',
    method: 'post',
    params: params
  })
}
// 下架商品
export function shelfGoods (params) {
  return request({
    url: '/admin/shelf_goods',
    method: 'post',
    data: params
  })
}
// 暂停转上架商品
export function goodsShelf (params) {
  return request({
    url: '/admin/goods_shelf',
    method: 'post',
    params: params
  })
}
// 获取报错信息接口
export function getErrorInfo (params) {
  return request({
    url: '/admin/get_error_info',
    method: 'get',
    params: params
  })
}
// 管理获取商品列表
export function getGoodsSelect (params) {
  return request({
    url: '/admin/get_goods_select',
    method: 'get',
    params: params
  })
}
// 修改商品
export function updateGoodsInfo (params) {
  return request({
    url: '/admin/update_goods_info',
    method: 'post',
    data: params
  })
}
